#include <iostream>
#include <new>
#include <stdexcept>
using namespace std;

int main(){
	string *s;
	try{
		s = new string("www.fuxi.com");
		cout << s->substr(15,5);
	}
	catch(bad_alloc &t){
		cout << "Exception occurred!" << t.what() << endl;
	}
	catch(out_of_range &t){
		cout << "Exception occurred!" << t.what() << endl;
	}
	
	return 0;
}
